#' ---
#' title: "Prepare Replication"
#' author: "Lukas F. Stoetzer"
#' date: "Feb 2022"
#' ---


# Prepare Scripts ============0

# Supress warning Messages
  defaultW <- getOption("warn")
  options(warn = -1)

# Install required packages ==========

# List of packages
  list.of.packages <- c("lmtest","tidyverse","ggridges","manifestoR", "ggrepel",
                        "randomForest","caret","quanteda",
                        "sandwich","emmeans","tidytext","kableExtra")

# Install Missing packages
  new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
  if(length(new.packages)) install.packages(new.packages)

# Load packages
  ifelse(all(unlist(lapply(list.of.packages, require, character.only = TRUE))),
          paste("All required packages loaded"),
          ("Not all required packages loaded"))



  
  